{{left_sidebar_enabled,right_sidebar_enabled=False,True}}
{{extend 'layout.html'}}
{{from ndsfunctions import truncquest}}
{{if 'message' in globals():}}
<h1>{{=message}}</h1>
{{pass}}

<div classs='MainDetails'>
{{=MARKMIN(subj.longdesc)}}

<h1>Highest Priority Actions</h1>
{{if actions:}}
<table class='issuetable'>
 <tr>
  <th width="12%">Status </th>
  <th width="60%">Action  </th>
  <th width="14%">Responsible </th>
  <th width="14%">Due Date</th>
 </tr>
 {{for row in actions:}}
 <tr class={{if row.status == 'In Progress':}}"inprogress"{{else:}}"resolved"{{pass}}>
  <td>
  <a href="{{=URL('viewquest','index',args=[row.id])}}">{{=row.status}}</a>
  </td>
  <td>
  {{=truncquest(row.questiontext)}}
  </td>
  <td>
  {{=row.responsible}}
  </td>
  <td>
  {{=prettydate(row.duedate.date())}}
  </td>
 </tr>
 {{pass}}
</table>
{{else:}}
<p>There are no actions created yet. </p>
{{pass}}


<h1>Recently Resolved Questions</h1>
{{if answers:}}
<table class='issuetable'>
 <tr> 
  <th width="4%">Level
  </th>
  <th width="55%">Question
  </th>
  <th width="22%">Answer
  </th>
  </th>
  <th width="8%">#Agree
  </th>
  <th width="11%">#Disagree
  </th>
 </tr>
 {{for row in answers:}}
 <tr class="resolved">
  <td>
  <a href="{{=URL('viewquest','index',args=[row.id])}}">{{=row.level}}</a>
  </td>
  <td>
  {{=truncquest(row.questiontext)}}
  </td>
  <td>
  {{=row.correctanstext}}
  </td>
  <td>
  {{=row.numagree}}
  </td>
  <td>
  {{=row.numdisagree}}
  </td>
 </tr>
 {{pass}}
</table>
{{else:}}
<p>There are no resolved questions yet. Please answer some more questions. </p>
{{pass}}


<h1>Top Priority Questions In Progress</h1>
{{if quests:}}
<table class='issuetable' >
 <tr>
  <th width="10%">Level
  </th>
  <th width="80%">Question
  </th>
  <th width="10%">Priority
  </th>
 </tr>
 {{for row in quests:}}
 <tr class="inprogress">
  <td>
 <a href="{{=URL('viewquest','index',args=[row.id])}}">{{=row.level}}</a>
  </td>
  <td>
  {{=truncquest(row.questiontext)}}
  </td>
  <td>
  {{=row.priority}}
  </td>
 </tr>
 {{pass}}
</table>

{{else:}}
<p>There are no questions in progress at present. Please submit some more questions</p>
{{pass}}


<p>Please be aware this is a prototype system and it is being actively developed.  No guarantees are made surrounding it's ongoing availability in its present form.  Feedback and suggestions for improvement are however very welcome. <a href="mailto:newglobalstrategy@gmail.com?Subject=Suggestion">Please E-Mail Feedback</a></p>
</div>

{{block right_sidebar}}
{{include 'sidebar.html'}}

{{end}}


